package com.bigtotoro.shuiyincamera;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.bigtotoro.shuiyincamera.view.ZoomImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.luck.picture.lib.photoview.PhotoView;
import com.umeng.analytics.MobclickAgent;

import java.io.File;
import java.util.List;

import qiu.niorgai.StatusBarCompat;

public class ImageDisplayActivity extends BaseActivity {


	private List<String> dataList;

	private PhotoView photoView;
	RequestOptions requestOptions;

	@SuppressWarnings("unchecked")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_image_display);
		StatusBarCompat.setStatusBarColor(this, Color.BLACK);
		initBase();

		dataList = getIntent().getStringArrayListExtra("images");
		if(dataList==null||dataList.size()==0){
			return;
		}
		photoView = findViewById(R.id.photo_view);


		requestOptions = new RequestOptions();
		requestOptions.placeholder(R.drawable.default_img_grey_light);
		requestOptions.error(R.drawable.default_img_grey_light);


		Glide.with(ImageDisplayActivity.this).applyDefaultRequestOptions(requestOptions).load(new File(dataList.get(0))).into(photoView);


	}
	


	@Override
	public void onResume() {
		super.onResume();
		MobclickAgent.onPageStart("ImageDisplayActivity");//统计页面
		MobclickAgent.onResume(this);
	}
	@Override
	public void onPause() {
		super.onPause();
		MobclickAgent.onPageEnd("ImageDisplayActivity");//统计页面
		MobclickAgent.onPause(this);
	}
}
